package com.test.spring.factory;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/9/25 20:59
 */
public class Main {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("beans-factory.xml");

        Car car = ctx.getBean("car", Car.class);
        System.out.println(car);

        Car car1 = ctx.getBean("car2", Car.class);
        System.out.println(car1);

        //关闭IOC容器
        ctx.close();
    }
}
